using System;
using System.Collections.Generic;
using System.Text;
using TermPreprocessor;

namespace TermPreprocessorTest
{
    public class Program
    {
        private static Random random = new Random();

        public static string getRandomString(int minL, int maxL)
        {
            int l = random.Next(minL, maxL);
            char[] word = new char[l];
            for (int i = 0; i < l; i++)
                word[i] = (char)random.Next(97, 122);
            return new string(word);
        }

        static void Main(string[] args)
        {
            StopWords sw = new StopWords(@"E:\my files\search engine\stopwords.dic");

            int testNum = 1000*10000;
            int minL = 2;
            int maxL = 6;
            DateTime start = DateTime.Now;

            for (int i = 0; i < testNum; i++)
                sw.IsStopWord(getRandomString(minL, maxL));
            

            TimeSpan diff = DateTime.Now - start;

            Console.WriteLine(" worked " + diff.Seconds + " sec. " + diff.Milliseconds + " ms.\n");
        }
    }
}
